﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 职工端
{
    public partial class 商品售出情况 : Form
    {
        string constr = denglu.strcon;
        DataSet myst = new DataSet();
        SqlDataAdapter myda;
        public 商品售出情况()
        {
            InitializeComponent();
            sx();
        }
        void sx()
        {
            SqlConnection sqlcon = new SqlConnection(constr);
            sqlcon.Open();
            string sql = "select Coid as 订单号,Caccount as 用户账号,gname as 商品名称,Codate as 出售日期,Coamount as 出售数量 from Corder,Goods where Goods.gid=Corder.gid and Costate='"+"已支付"+"'";
            SqlCommand cmd = new SqlCommand(sql,sqlcon);
            myda = new SqlDataAdapter(cmd);
            myst.Tables.Clear();
            myda.Fill(myst,"B");
            dataGridView1.DataSource = myst.Tables["B"];
        }
    }
}
